﻿//////////////////////////////////////////////////////////////////////////
// FileName:
// CreateBy:
// CreateDate:2010-6-14
// Description:
//		BusTransfer class
//
// Modify Log:
//
// Copyright:
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Auto.Components;

namespace Auto.Data.BusMan.Model
{
    [Serializable]
    public class BusTransfer
    {
        #region --Field--
        ///<summary>
        ///Data Table Bus_BusTransfer
        ///</summary>
        public const string TABLENAME_Bus_BusTransfer = "Bus_BusTransfer";
        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public const string FIELD_RecID = "RecID";
        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_DocID = "DocID";
        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_BusID = "BusID";
        /// <sumary> 
        /// (BusIdentificationNO Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_BusIdentificationNO = "BusIdentificationNO";
        /// <sumary> 
        /// (OrgCommpanyID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_OrgCommpanyID = "OrgCommpanyID";
        /// <sumary> 
        /// (OrgCompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_OrgCompanyName = "OrgCompanyName";
        /// <sumary> 
        /// (ToCompanyID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_ToCompanyID = "ToCompanyID";
        /// <sumary> 
        /// (ToCompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_ToCompanyName = "ToCompanyName";
        /// <sumary> 
        /// (OrgDriverID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_OrgDriverID = "OrgDriverID";
        /// <sumary> 
        /// (OrgDriverName Type:NVarChar Len:20) 
        /// </sumary> 
        public const string FIELD_OrgDriverName = "OrgDriverName";
        /// <sumary> 
        /// (ToDriverID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_ToDriverID = "ToDriverID";
        /// <sumary> 
        /// (ToDriverName Type:NVarChar Len:20) 
        /// </sumary> 
        public const string FIELD_ToDriverName = "ToDriverName";
        /// <sumary> 
        /// (TransferDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_TransferDate = "TransferDate";
        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecDivID = "RecDivID";
        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecAcct = "RecAcct";
        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_RecDate = "RecDate";
        /// <sumary> 
        /// (Note Type:NVarChar Len:200) 
        /// </sumary> 
        public const string FIELD_Note = "Note";
        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_UserAcct = "UserAcct";
        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_LastUpdateDate = "LastUpdateDate";
        #endregion --Field--

        #region --Property--
        private int _recid;
        private string _docid;
        private string _busid;
        private string _busidentificationno;
        private string _orgcommpanyid;
        private string _orgcompanyname;
        private string _tocompanyid;
        private string _tocompanyname;
        private string _orgdriverid;
        private string _orgdrivername;
        private string _todriverid;
        private string _todrivername;
        private DateTime _transferdate;
        private string _recdivid;
        private string _recacct;
        private DateTime _recdate;
        private string _note;
        private string _useracct;
        private DateTime _lastupdatedate;

        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public int RecID
        {
            set { _recid = value; }
            get { return _recid; }
        }

        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public string DocID
        {
            set { _docid = value; }
            get { return _docid; }
        }

        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public string BusID
        {
            set { _busid = value; }
            get { return _busid; }
        }

        /// <sumary> 
        /// (BusIdentificationNO Type:NVarChar Len:50) 
        /// </sumary> 
        public string BusIdentificationNO
        {
            set { _busidentificationno = value; }
            get { return _busidentificationno; }
        }

        /// <sumary> 
        /// (OrgCommpanyID Type:VarChar Len:20) 
        /// </sumary> 
        public string OrgCommpanyID
        {
            set { _orgcommpanyid = value; }
            get { return _orgcommpanyid; }
        }

        /// <sumary> 
        /// (OrgCompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public string OrgCompanyName
        {
            set { _orgcompanyname = value; }
            get { return _orgcompanyname; }
        }

        /// <sumary> 
        /// (ToCompanyID Type:VarChar Len:20) 
        /// </sumary> 
        public string ToCompanyID
        {
            set { _tocompanyid = value; }
            get { return _tocompanyid; }
        }

        /// <sumary> 
        /// (ToCompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public string ToCompanyName
        {
            set { _tocompanyname = value; }
            get { return _tocompanyname; }
        }

        /// <sumary> 
        /// (OrgDriverID Type:VarChar Len:20) 
        /// </sumary> 
        public string OrgDriverID
        {
            set { _orgdriverid = value; }
            get { return _orgdriverid; }
        }

        /// <sumary> 
        /// (OrgDriverName Type:NVarChar Len:20) 
        /// </sumary> 
        public string OrgDriverName
        {
            set { _orgdrivername = value; }
            get { return _orgdrivername; }
        }

        /// <sumary> 
        /// (ToDriverID Type:VarChar Len:20) 
        /// </sumary> 
        public string ToDriverID
        {
            set { _todriverid = value; }
            get { return _todriverid; }
        }

        /// <sumary> 
        /// (ToDriverName Type:NVarChar Len:20) 
        /// </sumary> 
        public string ToDriverName
        {
            set { _todrivername = value; }
            get { return _todrivername; }
        }

        /// <sumary> 
        /// (TransferDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime TransferDate
        {
            set { _transferdate = value; }
            get { return _transferdate; }
        }

        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public string RecDivID
        {
            set { _recdivid = value; }
            get { return _recdivid; }
        }

        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string RecAcct
        {
            set { _recacct = value; }
            get { return _recacct; }
        }

        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime RecDate
        {
            set { _recdate = value; }
            get { return _recdate; }
        }

        /// <sumary> 
        /// (Note Type:NVarChar Len:200) 
        /// </sumary> 
        public string Note
        {
            set { _note = value; }
            get { return _note; }
        }

        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string UserAcct
        {
            set { _useracct = value; }
            get { return _useracct; }
        }

        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime LastUpdateDate
        {
            set { _lastupdatedate = value; }
            get { return _lastupdatedate; }
        }

        #endregion --Property--

        #region --New--
        /// <summary>
        /// Constructed Function
        /// </summary>
        public BusTransfer()
        {
            Init();
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dr">DataRow</param>
        public BusTransfer(DataRow dr)
        {
            Init();
            SetModel(dr);
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dt">DataTable</param>
        public BusTransfer(DataTable dt)
        {
            Init();
            SetModel(dt);
        }
        #endregion --New--

        #region --Private--
        /// <summary>
        /// Init The Private variable
        /// </summary>
        private void Init()
        {
            _recid = 0;
            _docid = string.Empty;
            _busid = string.Empty;
            _busidentificationno = string.Empty;
            _orgcommpanyid = string.Empty;
            _orgcompanyname = string.Empty;
            _tocompanyid = string.Empty;
            _tocompanyname = string.Empty;
            _orgdriverid = string.Empty;
            _orgdrivername = string.Empty;
            _todriverid = string.Empty;
            _todrivername = string.Empty;
            _transferdate = DateTime.MinValue;
            _recdivid = string.Empty;
            _recacct = string.Empty;
            _recdate = DateTime.MinValue;
            _note = string.Empty;
            _useracct = string.Empty;
            _lastupdatedate = DateTime.MinValue;
        }
        /// <summary>
        /// SetModel By DataRow
        /// </summary>
        /// <param name="dr">DataRow</param>
        /// <returns>BusTransfer</returns>
        private BusTransfer SetModel(DataRow dr)
        {
            _recid = StrHelper.GetIntValue(dr[FIELD_RecID]);
            _docid = StrHelper.GetStringValue(dr[FIELD_DocID]);
            _busid = StrHelper.GetStringValue(dr[FIELD_BusID]);
            _busidentificationno = StrHelper.GetStringValue(dr[FIELD_BusIdentificationNO]);
            _orgcommpanyid = StrHelper.GetStringValue(dr[FIELD_OrgCommpanyID]);
            _orgcompanyname = StrHelper.GetStringValue(dr[FIELD_OrgCompanyName]);
            _tocompanyid = StrHelper.GetStringValue(dr[FIELD_ToCompanyID]);
            _tocompanyname = StrHelper.GetStringValue(dr[FIELD_ToCompanyName]);
            _orgdriverid = StrHelper.GetStringValue(dr[FIELD_OrgDriverID]);
            _orgdrivername = StrHelper.GetStringValue(dr[FIELD_OrgDriverName]);
            _todriverid = StrHelper.GetStringValue(dr[FIELD_ToDriverID]);
            _todrivername = StrHelper.GetStringValue(dr[FIELD_ToDriverName]);
            _transferdate = StrHelper.GetDateTimeValue(dr[FIELD_TransferDate]);
            _recdivid = StrHelper.GetStringValue(dr[FIELD_RecDivID]);
            _recacct = StrHelper.GetStringValue(dr[FIELD_RecAcct]);
            _recdate = StrHelper.GetDateTimeValue(dr[FIELD_RecDate]);
            _note = StrHelper.GetStringValue(dr[FIELD_Note]);
            _useracct = StrHelper.GetStringValue(dr[FIELD_UserAcct]);
            _lastupdatedate = StrHelper.GetDateTimeValue(dr[FIELD_LastUpdateDate]);
            return this;
        }
        /// <summary>
        /// SetModel By DataTable
        /// </summary>
        /// <param name="dt">DataTable</param>
        /// <returns>BusTransfer</returns>
        private BusTransfer SetModel(DataTable dt)
        {
            foreach (DataRow dr in dt.Rows)
            {
                SetModel(dr);
                break;
            }
            return this;
        }
        #endregion --Private--

    }
}

